package com.creatapark.constant;

import java.util.stream.Stream;

/**
 * WeekType
 *
 * @author Bruce01.fan
 * @date 2017/12/9
 */
public enum WeekType {
    Monday("星期一","#ec5d51"),
    Tuesday("星期二","#59abe1"),
    Wednesday("星期三","#f4cf42"),
    Thursday("星期四","#3dc6a8"),
    Friday("星期五","#86D560"),
    Saturday("星期六","#AF89D6"),
    Sunday("星期日","#59ADF3");

    private String name;
    private String color;

    WeekType(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public static String getColor(String name) {
        return Stream.of(WeekType.values()).filter(week -> name.equals(week.getName())).findFirst().get().getColor();

    }
}
